home *** CD-ROM | disk | FTP | other *** search
- package java.awt;
-
- import java.awt.peer.FramePeer;
-
- public class Frame extends Window implements MenuContainer {
- public static final int DEFAULT_CURSOR = 0;
- public static final int CROSSHAIR_CURSOR = 1;
- public static final int TEXT_CURSOR = 2;
- public static final int WAIT_CURSOR = 3;
- public static final int SW_RESIZE_CURSOR = 4;
- public static final int SE_RESIZE_CURSOR = 5;
- public static final int NW_RESIZE_CURSOR = 6;
- public static final int NE_RESIZE_CURSOR = 7;
- public static final int N_RESIZE_CURSOR = 8;
- public static final int S_RESIZE_CURSOR = 9;
- public static final int W_RESIZE_CURSOR = 10;
- public static final int E_RESIZE_CURSOR = 11;
- public static final int HAND_CURSOR = 12;
- public static final int MOVE_CURSOR = 13;
- String title;
- Image icon;
- MenuBar menuBar;
- boolean resizable;
- Image cursorImage;
- int cursorType;
- Color cursorFg;
- Color cursorBg;
-
- public Frame() {
- this.title = "Untitled";
- this.resizable = true;
- this.cursorType = 0;
- super.visible = false;
- ((Container)this).setLayout(new BorderLayout());
- }
-
- public Frame(String var1) {
- this();
- this.title = var1;
- }
-
- public synchronized void addNotify() {
- if (super.peer == null) {
- super.peer = ((Window)this).getToolkit().createFrame(this);
- }
-
- if (this.menuBar != null) {
- this.menuBar.addNotify();
- ((FramePeer)super.peer).setMenuBar(this.menuBar);
- }
-
- super.addNotify();
- }
-
- public String getTitle() {
- return this.title;
- }
-
- public void setTitle(String var1) {
- this.title = var1;
- FramePeer var2 = (FramePeer)super.peer;
- if (var2 != null) {
- var2.setTitle(var1);
- }
-
- }
-
- public Image getIconImage() {
- return this.icon;
- }
-
- public void setIconImage(Image var1) {
- this.icon = var1;
- FramePeer var2 = (FramePeer)super.peer;
- if (var2 != null) {
- var2.setIconImage(var1);
- }
-
- }
-
- public MenuBar getMenuBar() {
- return this.menuBar;
- }
-
- public synchronized void setMenuBar(MenuBar var1) {
- if (this.menuBar != var1) {
- if (var1.parent != null) {
- var1.parent.remove(var1);
- }
-
- if (this.menuBar != null) {
- this.remove(this.menuBar);
- }
-
- this.menuBar = var1;
- this.menuBar.parent = this;
- FramePeer var2 = (FramePeer)super.peer;
- if (var2 != null) {
- this.menuBar.addNotify();
- var2.setMenuBar(this.menuBar);
- }
-
- }
- }
-
- public synchronized void remove(MenuComponent var1) {
- if (var1 == this.menuBar) {
- FramePeer var2 = (FramePeer)super.peer;
- if (var2 != null) {
- this.menuBar.removeNotify();
- this.menuBar.parent = null;
- var2.setMenuBar((MenuBar)null);
- }
-
- this.menuBar = null;
- }
-
- }
-
- public synchronized void dispose() {
- if (this.menuBar != null) {
- this.remove(this.menuBar);
- this.menuBar = null;
- }
-
- super.dispose();
- }
-
- public boolean isResizable() {
- return this.resizable;
- }
-
- public void setResizable(boolean var1) {
- this.resizable = var1;
- FramePeer var2 = (FramePeer)super.peer;
- if (var2 != null) {
- var2.setResizable(var1);
- }
-
- }
-
- public void setCursor(int var1) {
- if (var1 >= 0 && var1 <= 13) {
- this.cursorType = var1;
- if (super.peer != null) {
- ((FramePeer)super.peer).setCursor(var1);
- }
-
- } else {
- throw new IllegalArgumentException("illegal cursor type");
- }
- }
-
- public int getCursorType() {
- return this.cursorType;
- }
-
- protected String paramString() {
- String var1 = super.paramString();
- if (this.resizable) {
- var1 = var1 + ",resizable";
- }
-
- if (this.title != null) {
- var1 = var1 + ",title=" + this.title;
- }
-
- return var1;
- }
- }
-